#include <stdio.h>
#include <stdlib.h>
#include <sys/time.h>
#include <time.h>

int main()
{
    struct timeval t;
    t.tv_sec = 123456789;
    t.tv_usec = 0;
    int r = settimeofday(&t,NULL);
    if(!r)
    {
        printf("settimeofdat() failed\n");
        return -1;
    }
    gettimeofday(&t,NULL);
    printf("sec = %ld , usec = %ld\n",t.tv_sec,t.tv_usec);
    printf("%s",ctime(&t.tv_sec));
    return 0;
}
